package org.simple.spring.ssh.service;

import org.simple.spring.ssh.dao.UserDao;
import org.simple.spring.ssh.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public void saveUsers(List<User> us) {
        for (User u : us) {
            userDao.save(u);
        }
    }

    @Override
    public List<User> getAllUsernames() {
        return userDao.findAll();
    }

}
